<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>案例1</title>
		<style type="text/css">
			#div1 {
				width: 200px;
				height: 200px;
				background: #000000;
				display: block;
			}
			#div2{
				margin: 40px;
			}
		</style>
	</head>
	<body>
		<div id="div2">
			<button type="button" id="btn1">变宽</button>
			<button type="button" id="btn2">变高</button>
			<button type="button" id="btn3">变色</button>
			<button type="button" id="btn4">隐藏</button>
			<button type="button" id="btn5">重置</button>
			<div id="div1">
			</div>
		</div>
		
	</body>
</html>
<script src="../js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	$(function() {
		$("#btn1").click(function() {
			$("#div1").css({
				"width": "400px"
			});
		});
		$("#btn2").click(function() {
			$("#div1").css({
				"height": "400px"
			});
		});
		$("#btn3").click(function() {
			$("#div1").css({
				"background": "red"
			});
		});
		$("#btn4").click(function() {
			$("#div1").css({
				"display": "none"
			});
		});
		$("#btn5").click(function() {
			$("#div1").css({
				"width": "200px","height": "200px","background": "black","display": "block"
			});
		});
	});
</script>
